import { useAxios } from '@/hooks/web/useAxios'
import { ProPlanVO,ProPlanPageReqVO,ProPlanExcelReqVO } from './types'

const request = useAxios()

// 查询计划数据列表
export const getProPlanPageApi = async (params: ProPlanPageReqVO) => {
    return await request.get({ url: '/water/pro-plan/page', params })
}

// 查询计划数据详情
export const getProPlanApi = async (id: number) => {
    return await request.get({ url: '/water/pro-plan/get?id=' + id })
}

// 新增计划数据
export const createProPlanApi = async (data: ProPlanVO) => {
    return await request.post({ url: '/water/pro-plan/create', data })
}

// 修改计划数据
export const updateProPlanApi = async (data: ProPlanVO) => {
    return await request.put({ url: '/water/pro-plan/update', data })
}

// 删除计划数据
export const deleteProPlanApi = async (id: number) => {
    return await request.delete({ url: '/water/pro-plan/delete?id=' + id })
}

// 导出计划数据 Excel
export const exportProPlanApi = async (params: ProPlanExcelReqVO) => {
    return await request.download({ url: '/water/pro-plan/export-excel', params })
}
